Contents Prev Next Up


3.10 Conversion Operations

i2l

Integer to long integer conversion
 
i2l = 133

Stack: ..., value => ..., result-word1, result-word2

value must be an integer. It is converted to a long integer. The result replaces value on the stack.

i2f

Integer to single float
 
i2f = 134

Stack: ..., value => ..., result

value must be an integer. It is converted to a single-precision floating point number. The result replaces value on the stack.

i2d

Integer to double float
 
i2d = 135

Stack: ..., value => ..., result-word1, result-word2

value must be an integer. It is converted to a double-precision floating point number. The result replaces value on the stack.

l2i

Long integer to integer
 
l2i = 136

Stack: ..., value-word1, value-word2 => ..., result

value must be a long integer. It is converted to an integer by taking the low-order 32 bits. The result replaces value on the stack.

l2f

Long integer to single float
 
l2f = 137

Stack: ..., value-word1, value-word2 => ..., result

value must be a long integer. It is converted to a single-precision floating point number. The result replaces value on the stack.

l2d

Long integer to double float
 
l2d = 138

Stack: ..., value-word1, value-word2 => ..., result-word1, result-word2

value must be a long integer. It is converted to a double-precision floating point number. The result replaces value on the stack.

f2i

Single float to integer
 
f2i = 139

Stack: ..., value => ..., result

value must be a single-precision floating point number. It is converted to an integer. The result replaces value on the stack. See The Java Language Specification for details on converting floating point numbers to integers.

Note: Mustn't refer to the Java Language Specification; give semantics here.

f2l

Single float to long integer
 
f2l = 140

Stack: ..., value => ..., result-word1, result-word2

value must be a single-precision floating point number. It is converted to a long integer. The result replaces value on the stack. See The Java Language Specification for details on converting floating point numbers to integers.

Note: Mustn't refer to the Java Language Specification; give semantics here.

f2d

Single float to double float
 
f2d = 141

Stack: ..., value => ..., result-word1, result-word2

value must be a single-precision floating point number. It is converted to a double-precision floating point number. The result replaces value on the stack.

d2i

Double float to integer
 
d2i = 142

Stack: ..., value-word1, value-word2 => ..., result

value must be a double-precision floating point number. It is converted to an integer. The result replaces value on the stack. See The Java Language Specification for details on converting floating point numbers to integers.

Note: Mustn't refer to the Java Language Specification; give semantics here.

d2l

Double float to long integer
 
d2l = 143

Stack: ..., value-word1, value-word2 => ..., result-word1, result-word2

value must be a double-precision floating point number. It is converted to a long integer. The result replaces value on the stack. See The Java Language Specification for details on converting floating point numbers to integers.

Note: Mustn't refer to the Java Language Specification; give semantics here.

d2f

Double float to single float
 
d2f = 144

Stack: ..., value-word1, value-word2 => ..., result

value must be a double-precision floating point number. It is converted to a single-precision floating point number. If overflow occurs, the result must be infinity with the same sign as value. The result replaces value on the stack.

int2byte

Integer to signed byte
 
int2byte = 145

Stack: ..., value => ..., result

value must be an integer. It is truncated to a signed 8-bit result, then sign extended to an integer. The result replaces value on the stack.

int2char

 
int2char = 146
Integer to char

Stack: ..., value => ..., result

value must be an integer. It is truncated to an unsigned 16-bit result, then zero extended to an integer. The result replaces value on the stack.

int2short

 
int2short = 147
Integer to short

Stack: ..., value => ..., result

value must be an integer. It is truncated to a signed 16-bit result, then sign extended to an integer. The result replaces value on the stack.


Contents Prev Next Up